import React from 'react'
import {Redirect} from 'react-router-dom'

import Discover from '@/pages/discover'
import Mine from '@/pages/mine'
import Friend from '@/pages/friend'

import Recommend from '@/pages/discover/recommend'
import TopList from '@/pages/discover/toplist'
import PlayList from '@/pages/discover/playlist'
import DjRadio from '@/pages/discover/djradio'
import Artist from '@/pages/discover/artist'
import Album from '@/pages/discover/album'

export const routes = [
  {
    path:'/',
    exact:true,
    render:() => <Redirect to="/discover" /> 
  },
  {
    path:'/discover',
    component:Discover, 
    routes:[
      {
        path:'/discover',
        exact:true,
        render:() => <Redirect to="/discover/recommend" />,
      },
      {
        path:'/discover/recommend',
        component:Recommend
      },
      {
        path:'/discover/toplist',
        component:TopList
      },
      {
        path:'/discover/playlist',
        component:PlayList
      },
      {
        path:'/discover/djradio',
        component:DjRadio
      },
      {
        path:'/discover/artist',
        component:Artist
      },
      {
        path:'/discover/album',
        component:Album
      }
    ]
  },
  {
    path:'/mine',
    component:Mine
  },
  {
    path:'/friend',
    component:Friend
  }
]